﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace WCFClintForm
{
    public class RXRequest
    {
        /// <summary>
        /// 医院编号
        /// </summary>
        [DataMember]
        public string HinCode
        {
            get;
            set;
        }

        /// <summary>
        /// 分院编号
        /// </summary>
        [DataMember]
        public string HinFacilityCode
        {
            get;
            set;
        }

        /// <summary>
        /// DUR_WARNING（返回报警，默认）
        /// NO_DUR_WARNING（不返回报警，异步方式，执行很快）
        /// </summary>
        [DataMember]
        public string CheckMode
        {
            get;
            set;
        }

        /// <summary>
        /// Y/N
        /// </summary>
        [DataMember]
        public string CommitMode
        {
            get;
            set;
        }

        /// <summary>
        /// OUTPATIENT（默认）
        /// INPATIENT
        /// </summary>
        [DataMember]
        public string PatientTypeCode
        {
            get;
            set;
        }

        /// <summary>
        /// 病案号
        /// </summary>
        [DataMember]
        public string CaseFileIdent
        {
            get;
            set;
        }

        /// <summary>
        /// 处方号/住院号(如果PATIENT_TYPE_CODE=INPATIENT的话，则该项是必填的。)
        /// </summary>
        [DataMember]
        public string RXCode
        {
            get;
            set;
        }

        /// <summary>
        /// 普通处方:1 （默认）
        /// 急诊处方:2
        /// 麻醉药品处方:3
        /// 儿科处方:4
        /// </summary>
        [DataMember]
        public string RXType
        {
            get;
            set;
        }

        /// <summary>
        /// 审核调配药师姓名 （处方点评使用）
        /// </summary>
        [DataMember]
        public string AuditPharmacistName
        {
            get;
            set;
        }

        /// <summary>
        /// 检查药师姓名 （处方点评使用）
        /// </summary>
        [DataMember]
        public string CheckPharmacistName
        {
            get;
            set;
        }

        /// <summary>
        /// 门诊日期，入院时间(格式：yyyyMMdd)
        /// </summary>
        [DataMember]
        public string AdmissionDate
        {
            get;
            set;
        }

        /// <summary>
        /// 出院时间(格式：yyyyMMdd)
        /// </summary>
        [DataMember]
        public string DischargeDate
        {
            get;
            set;
        }

        /// <summary>
        /// 科室编码
        /// </summary>
        [DataMember]
        public string DepartmentCode
        {
            get;
            set;
        }

        /// <summary>
        /// 科室名称
        /// </summary>
        [DataMember]
        public string DepartmentName
        {
            get;
            set;
        }

        /// <summary>
        /// 科室电脑的MAC地址
        /// </summary>
        [DataMember]
        public string MacAddress
        {
            get;
            set;
        }

        /// <summary>
        /// HIS中，患者的ID编号
        /// </summary>
        [DataMember]
        public string PatientID
        {
            get;
            set;
        }

        /// <summary>
        /// 患者身份证号，或患者的就诊卡号
        /// </summary>
        [DataMember]
        public string PatientCardNumber
        {
            get;
            set;
        }

        /// <summary>
        /// 患者姓名
        /// </summary>
        [DataMember]
        public string PatientName
        {
            get;
            set;
        }

        /// <summary>
        /// 患者性别M：男性（默认）F: 女性
        /// </summary>
        [DataMember]
        public string PatientGender
        {
            get;
            set;
        }

        /// <summary>
        /// 患者出生日期(格式：yyyyMMdd)
        /// </summary>
        [DataMember]
        public string PatientDOB
        {
            get;
            set;
        }

        [DataMember]
        public int PatientHeight
        {
            get;
            set;
        }
        [DataMember]
        public int PatientWeight
        {
            get;
            set;
        }

        /// <summary>
        /// 是否怀孕
        /// </summary>
        [DataMember]
        public int PregnantDays
        {
            get;
            set;
        }

        /// <summary>
        /// 是否哺乳
        /// </summary>
        [DataMember]
        public string IsBreastfeeding
        {
            get;
            set;
        }

        /// <summary>
        /// 患者肝功能情况
        /// </summary>
        [DataMember]
        public string LiverFunctionDamage
        {
            get;
            set;
        }

        /// <summary>
        /// 患者肾功能情况
        /// </summary>
        [DataMember]
        public string KidneyFunctionDamage
        {
            get;
            set;
        }

        /// <summary>
        /// 患者医疗保险号
        /// </summary>
        [DataMember]
        public string PatientMedicalInsuranceNum
        {
            get;
            set;
        }

        /// <summary>
        /// 患者医保类型
        /// </summary>
        [DataMember]
        public string PatientMedicalInsuranceType
        {
            get;
            set;
        }

        /// <summary>
        /// 医生姓名
        /// </summary>
        [DataMember]
        public string PhysicianName
        {
            get;
            set;
        }

        /// <summary>
        /// 医生编号
        /// </summary>
        [DataMember]
        public string PhysicianID
        {
            get;
            set;
        }

        /// <summary>
        /// 医生职称
        /// </summary>
        [DataMember]
        public string PhysicianTitle
        {
            get;
            set;
        }

        /// <summary>
        /// 过敏信息
        /// </summary>
        [DataMember]
        public DrugAllergy[] Allergy
        {
            get;
            set;
        }

        /// <summary>
        /// 诊断信息
        /// </summary>
        [DataMember]
        public RXDiagnosis[] Diagnosis
        {
            get;
            set;
        }

        /// <summary>
        /// 药品信息
        /// </summary>
        [DataMember]
        public RXDrug[] Drug
        {
            get;
            set;
        }
    }

    public class DrugAllergy
    {
        [DataMember]
        public string CodeType
        {
            get;
            set;
        }
        [DataMember]
        public string CodeValue
        {
            get;
            set;
        }
    }

    public class RXDiagnosis
    {
        [DataMember]
        public string CodeType
        {
            get;
            set;
        }
        [DataMember]
        public string CodeValue
        {
            get;
            set;
        }
        [DataMember]
        public string CodeName
        {
            get;
            set;
        }
        [DataMember]
        public string IsHistoryDiagnosis
        {
            get;
            set;
        }
    }

    public class RXDrug
    {
        /// <summary>
        /// Y: 是（默认）
        /// N：否
        /// 如果是Y表示对该药品进行报警检查。如果是N表示不对该药品进行报警检查。
        /// </summary>
        [DataMember]
        public string CheckMode
        {
            get;
            set;
        }

        /// <summary>
        /// 医嘱编码:如果HIS不提供，合理用药系统自动生成一个。
        /// </summary>
        [DataMember]
        public string EMRPrescriptionID
        {
            get;
            set;
        }

        /// <summary>
        /// OUTPATIENT_PRESCRIPTION : 门诊
        /// LONG_PRESCRIPTION ：长嘱
        /// TEMP_PRESCRIPTION ：临嘱
        /// DISCHARGE_PRESCRIPTION ：出院带药
        /// </summary>
        [DataMember]
        public string PrescriptionType
        {
            get;
            set;
        }

        /// <summary>
        /// 医嘱开始时间(格式：yyyyMMdd)
        /// </summary>
        [DataMember]
        public string PrescriptionStartDate
        {
            get;
            set;
        }

        /// <summary>
        /// 医嘱结束时间(格式：yyyyMMdd)
        /// </summary>
        [DataMember]
        public string PrescriptionEndDate
        {
            get;
            set;
        }

        /// <summary>
        /// 药品编码
        /// </summary>
        [DataMember]
        public string LocalDrugID
        {
            get;
            set;
        }

        /// <summary>
        /// 单次剂量给药单位
        /// </summary>
        [DataMember]
        public string DoseUnitPerIntake
        {
            get;
            set;
        }

        /// <summary>
        /// 服用方式
        /// </summary>
        [DataMember]
        public string RouteCode
        {
            get;
            set;
        }

        /// <summary>
        /// 单次剂量
        /// </summary>
        [DataMember]
        public double DosePerIntake
        {
            get;
            set;
        }

        /// <summary>
        /// 每日频次
        /// </summary>
        [DataMember]
        public int DailyFrequency
        {
            get;
            set;
        }

        /// <summary>
        /// 天数频次
        /// </summary>
        [DataMember]
        public int FrequencyDays
        {
            get;
            set;
        }

        /// <summary>
        /// 频次描述(tid,bid......)
        /// </summary>
        [DataMember]
        public string Frequency
        {
            get;
            set;
        }

        /// <summary>
        /// 组号
        /// </summary>
        [DataMember]
        public string GroupNo
        {
            get;
            set;
        }

        /// <summary>
        /// 药品服用天数
        /// </summary>
        [DataMember]
        public int DaysSupply
        {
            get;
            set;
        }

        /// <summary>
        /// 药品总药量
        /// </summary>
        [DataMember]
        public double QuantitySupply
        {
            get;
            set;
        }

        /// <summary>
        /// 包装数量
        /// </summary>
        [DataMember]
        public int PackageCount
        {
            get;
            set;
        }

        /// <summary>
        /// 包装单位
        /// </summary>
        [DataMember]
        public string PackageUnit
        {
            get;
            set;
        }

        /// <summary>
        /// 自费金额
        /// </summary>
        [DataMember]
        public double OutOfPocketAmt
        {
            get;
            set;
        }

        /// <summary>
        /// 医保支付金额
        /// </summary>
        [DataMember]
        public double PlanPayAmt
        {
            get;
            set;
        }

        /// <summary>
        /// 患者支付总金额
        /// </summary>
        [DataMember]
        public double PatientPayAmt
        {
            get;
            set;
        }

        /// <summary>
        /// 医生姓名
        /// </summary>
        [DataMember]
        public string PhysicianName
        {
            get;
            set;
        }

        /// <summary>
        /// 医生编号
        /// </summary>
        [DataMember]
        public string PhysicianID
        {
            get;
            set;
        }
        /// <summary>
        /// 医生职称
        /// </summary>
        [DataMember]
        public string PhysicianTitle
        {
            get;
            set;
        }
        /// <summary>
        /// 超过最大使用天数说明
        /// </summary>
        [DataMember]
        public string OverDaysDiscription
        {
            get;
            set;
        }

    }
}
